﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NLog;

namespace WS.EKA.LogBridge
{
    public class Log
    {
        private static object obj = new object();
        protected static Logger logger;

        static Log()
        {
            InitLogger();
            LogManager.EnableLogging();
        }

        protected static void InitLogger()
        {
            lock (obj)
            {
                if (logger == null)
                {
                    logger = LogManager.GetLogger("MobileWebLogger");
                }
            }
        }
        public static void Info(string message)
        {
            logger.Log(LogLevel.Info, message);
        }

        public static void Error(string message, Exception ex)
        {
            logger.ErrorException(message+ex.StackTrace, ex);
            
        }
    }
}
